﻿@{
    ViewBag.Title = "查询结算信息";
    Layout = "~/Views/Shared/_Index.cshtml";
}
@Html.Partial("_YibaoCommonView")
<style>
    table tr td span {
        font-size:25px;
        color:lightcoral;
    }
</style>
<div class="panel">
    <div style="border-bottom:1px solid rgb(221, 221, 221);">
        <table class="form">
            <tr>
                <th class="formTitle">查询类型：</th>
                <td class="formValue">
                    <select id="jslx" class="form-control">
                        <option value="0">未结算</option>
                        <option value="1">已结算</option>
                    </select>
                </td>
                <th class="formTitle">社保编号：</th>
                <td class="formValue">
                    <input id="sbbh" name="sbbh" type="text" class="form-control" placeholder="请输入社保编号" />
                </td>
                <td>
                    <input type="button" id="btn_search" class="btn btn-primary form-an" style="width:40%;margin-left:10%;" value="查询" />
                </td>
                <td></td>
                <td></td>
            </tr>           
        </table>
    </div>
    <div id="wjs" style="border-bottom:1px solid rgb(221, 221, 221);margin-top:20px;">
        <table class="table" id="tb1">
            <tr>
                <th class="formTitle">社保编号</th>
                <th class="formTitle">医院编码</th>
                <th class="formTitle">结算号</th>
                <th class="formTitle">费用性质名称</th>
                <th class="formTitle">是否自费</th>
            </tr>
            <tr>                
                <td><span id="DAC001"></span></td>
                <td><span id="AAZ107"></span></td>
                <td><span id="DKE005"></span></td>
                <td><span id="AKE556_C"></span></td>
                <td><span id="DKE164"></span></td>
            </tr>
            <tr>
                <th class="formTitle">医保性质名称</th>
                <th class="formTitle">医保类别名称</th> 
                <th class="formTitle">总费用</th>
                <th class="formTitle">现金支付</th>
                <th class="formTitle">一般可报费用</th>
            </tr>
            <tr>
                <td><span id="DKC003_C"></span></td>
                <td><span id="DKC002_C"></span></td>
                <td><span id="ZFY"></span></td>
                <td><span id="XJZF"></span></td>
                <td><span id="YBFY"></span></td>
            </tr>
            <tr>
                <th class="formTitle">特殊总费用</th>
                <th class="formTitle">特殊自理费用</th>
                <th class="formTitle">基本帐户支付</th>
                <th class="formTitle">公补帐户支付</th>
                <th class="formTitle">结算时间</th>
            </tr>
            <tr>
                <td><span id="TSFY"></span></td>
                <td><span id="TSFYZL"></span></td>
                <td><span id="JBZF"></span></td>
                <td><span id="GBZF"></span></td>
                <td><span id="AKE293"></span></td>
            </tr>
        </table>
    </div>
    <div id="yjs" style="border-bottom:1px solid rgb(221, 221, 221);margin-top:20px;display:none;height:500px;overflow-y:auto">
        <table class="table" id="tb2">
            <tr>
                <th>社保编号</th>
                <th>医院编码</th>
                <th>结算号</th>
                <th>费用性质</th>
                <th>是否自费</th>
                <th>医保性质</th>
                <th>医保类别</th>
                <th>结算时间</th>
                <th>总费用</th>
                <th>现金支付</th>
                <th>一般可报费用</th>
                <th>特殊总费用</th>
                <th>特殊自理费用</th>
                <th>基本帐户支付</th>
                <th>公补帐户支付</th>
            </tr>
        </table>
    </div>
</div>
<script type="text/javascript">
    $("#btn_search").click(function () {  
        var jslx = $("#jslx").val();//结算类型
        var sbbh = $("#sbbh").val();//社保编号
        if (sbbh == "") {
            $.modalAlert("社保编号不能为空", 'warning');
            return false;
        }
        $.loading(true);
        setTimeout(function () {
            if (jslx == "0") {
                $("#wjs").show()
                $("#yjs").hide();
                var wjsobj = $.yibao.QUnSettleFee(sbbh);
                $.loading(false);
                if (wjsobj && wjsobj.Code == 0) {
                    $("#DAC001").html(wjsobj.Data.DAC001);
                    $("#AAZ107").html(wjsobj.Data.AAZ107);
                    $("#DKE005").html(wjsobj.Data.DKE005);
                    $("#AKE556_C").html(wjsobj.Data.AKE556_C);
                    $("#DKE164").html(wjsobj.Data.DKE164);
                    $("#DKC003_C").html(wjsobj.Data.DKC003_C);
                    $("#DKC002_C").html(wjsobj.Data.DKC002_C);
                    $("#AKE293").html(wjsobj.Data.AKE293);
                    $("#ZFY").html(wjsobj.Data.ZFY);
                    $("#XJZF").html(wjsobj.Data.XJZF);
                    $("#YBFY").html(wjsobj.Data.YBFY);
                    $("#TSFY").html(wjsobj.Data.TSFY);
                    $("#TSFYZL").html(wjsobj.Data.TSFYZL);
                    $("#JBZF").html(wjsobj.Data.JBZF);
                    $("#GBZF").html(wjsobj.Data.GBZF);
                }
                else {
                    $("#DAC001").html("无");
                    $("#AAZ107").html("无");
                    $("#DKE005").html("无");
                    $("#AKE556_C").html("无");
                    $("#DKE164").html("无");
                    $("#DKC003_C").html("无");
                    $("#DKC002_C").html("无");
                    $("#AKE293").html("无");
                    $("#ZFY").html("无");
                    $("#XJZF").html("无");
                    $("#YBFY").html("无");
                    $("#TSFY").html("无");
                    $("#TSFYZL").html("无");
                    $("#JBZF").html("无");
                    $("#GBZF").html("无");
                }
            }
            else {
                $("#wjs").hide()
                $("#yjs").show();
                $("#tb2  tr:not(:first)").empty("");
                var jsobj = $.yibao.QSettleFee(sbbh);
                $.loading(false);
                if (jsobj && jsobj.Code == 0) {
                    var tb = document.getElementById("tb2");
                    var td;
                    for (var i = 0; i < jsobj.Data.length; i++) {
                        var tr = tb.insertRow(i + 1);//添加新行，i就是要添加的位置
                        td = tr.insertCell();
                        td.innerHTML = jsobj.Data[i].DAC001;
                        td = tr.insertCell();
                        td.innerHTML = jsobj.Data[i].AAZ107;
                        td = tr.insertCell();
                        td.innerHTML = jsobj.Data[i].DKE005;
                        td = tr.insertCell();
                        td.innerHTML = jsobj.Data[i].AKE556_C;
                        td = tr.insertCell();
                        td.innerHTML = jsobj.Data[i].DKE164;
                        td = tr.insertCell();
                        td.innerHTML = jsobj.Data[i].DKC003_C;
                        td = tr.insertCell();
                        td.innerHTML = jsobj.Data[i].DKC002_C;
                        td = tr.insertCell();
                        td.innerHTML = jsobj.Data[i].AKE293;
                        td = tr.insertCell();
                        td.innerHTML = jsobj.Data[i].ZFY;
                        td = tr.insertCell();
                        td.innerHTML = jsobj.Data[i].XJZF;
                        td = tr.insertCell();
                        td.innerHTML = jsobj.Data[i].YBFY;
                        td = tr.insertCell();
                        td.innerHTML = jsobj.Data[i].TSFY;
                        td = tr.insertCell();
                        td.innerHTML = jsobj.Data[i].TSFYZL;
                        td = tr.insertCell();
                        td.innerHTML = jsobj.Data[i].JBZF;
                        td = tr.insertCell();
                        td.innerHTML = jsobj.Data[i].GBZF;
                    }
                }
            }
        }, 1000);
    })
</script>
